from jinja2 import FileSystemLoader, Environment


loader = FileSystemLoader('templates')
env = Environment(loader=loader)
tpl=env.get_template('vars.conf.tpl')
data={'ip':'1.1.1.1'}

# 配置数据写入文件
# 方法1：render()
# with open('cicso_logging.conf','w') as f:
#     output =tpl.render(data=data)
#     f.write(output)

# 方法2：stream()
tpl.stream(data=data).dump('cicso_logging.conf')
